package com.wcs.exam.common.enums;

import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 评阅状态(1:未知、2:待阅卷、3:阅卷中、4:已阅卷)
 */
@Getter
@AllArgsConstructor(access = AccessLevel.PRIVATE)
public enum UserEvaluationStatusEnum {

    /**
     * 未考
     */
    UN_KNOW(1, "未知", ""),

    /**
     * 待阅卷
     */
    WAIT_MARKED(2, "待阅卷", ""),

    /**
     * 阅卷中
     */
    REVIEWING_PAPER(3, "阅卷中", ""),

    /**
     * 已阅卷
     */
    MARKING_COMPLETE(4, "已阅卷", "");

    /**
     * 编码
     */
    private final Integer code;

    /**
     * 描述
     */
    private final String desc;

    /**
     * 描述
     */
    private final String descEn;

    public static UserEvaluationStatusEnum byCode(Integer code) {
        if (code == null) {
            return null;
        }
        for (UserEvaluationStatusEnum examStatusEnum : UserEvaluationStatusEnum.values()) {
            if (examStatusEnum.getCode().equals(code)) {
                return examStatusEnum;
            }
        }
        return null;
    }
}
